
		Imports Acceso_a_Datos.Datos
		Namespace BO
		Partial Public Class tIntereses_x_Persona



# Region "tAreas"

		private mtAreas As New tAreas

		Public Property tAreas As tAreas
        Get
                mtAreas = mtAreas.TraerFiltradoListOf("IdAreas", Me.IdAreas).Item(0)
        Return mtAreas
        End Get
        Set
             If ((mtAreas Is Nothing) Or (Me.tAreas.Equals(value) = False)) Then
                If Not (Me.tAreas Is Nothing)
	               Dim oldtAreas As tAreas = Me.tAreas
                   Me.mtAreas = Nothing
                   oldtAreas.RemoveListatIntereses_x_Persona(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtAreas = value
                   Me.tAreas.AddListatIntereses_x_Persona(Me)
            	End If
             End If
        End Set
       End Property

# End Region



# Region "tPersonas"

		private mtPersonas As New tPersonas

		Public Property tPersonas As tPersonas
        Get
                mtPersonas = mtPersonas.TraerFiltradoListOf("IdPersona", Me.IdPersona).Item(0)
        Return mtPersonas
        End Get
        Set
             If ((mtPersonas Is Nothing) Or (Me.tPersonas.Equals(value) = False)) Then
                If Not (Me.tPersonas Is Nothing)
	               Dim oldtPersonas As tPersonas = Me.tPersonas
                   Me.mtPersonas = Nothing
                   oldtPersonas.RemoveListatIntereses_x_Persona(Me)
             	End If
            	If Not (value Is Nothing) Then
                   Me.mtPersonas = value
                   Me.tPersonas.AddListatIntereses_x_Persona(Me)
            	End If
             End If
        End Set
       End Property

# End Region


# Region "Lecturas que devuelven listas"
Public Function TraerTodosListOf() As List(Of tIntereses_x_Persona)
            Dim dtDatos As DataTable
            Dim listatIntereses_x_Persona As New List(Of tIntereses_x_Persona)
            Dim param As [String]
            param = (Me.mNombreEntidad + "_SelectAll")
            dtDatos = Me.ServidorDatos.TraerDataTable(param)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtIntereses_x_Persona As New tIntereses_x_Persona
				mtIntereses_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtIntereses_x_Persona.IdAreas = CType(dr.Item("IdAreas"),Integer)
				mtIntereses_x_Persona.Traer_objeto()
            	listatIntereses_x_Persona.Add( mtIntereses_x_Persona)
    		Next dr
Return listatIntereses_x_Persona
End Function

Public Function TraerFiltradoListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tIntereses_x_Persona)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatIntereses_x_Persona As New List(Of tIntereses_x_Persona)
            param = (Me.mNombreEntidad + "_Tx")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtIntereses_x_Persona As New tIntereses_x_Persona
				mtIntereses_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtIntereses_x_Persona.IdAreas = CType(dr.Item("IdAreas"),Integer)
				mtIntereses_x_Persona.Traer_objeto()
            	listatIntereses_x_Persona.Add( mtIntereses_x_Persona)
    		Next dr
Return listatIntereses_x_Persona
End Function

Public Function TraerFiltradoLikeListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tIntereses_x_Persona)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatIntereses_x_Persona As New List(Of tIntereses_x_Persona)
            param = (Me.mNombreEntidad + "_TxLike")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtIntereses_x_Persona As New tIntereses_x_Persona
				mtIntereses_x_Persona.IdPersona = CType(dr.Item("IdPersona"),Integer)
				mtIntereses_x_Persona.IdAreas = CType(dr.Item("IdAreas"),Integer)
				mtIntereses_x_Persona.Traer_objeto()
            	listatIntereses_x_Persona.Add( mtIntereses_x_Persona)
    		Next dr
Return listatIntereses_x_Persona
End Function
# End Region

End Class
End Namespace
